<%@ page import="ee.ttu.rakarh.model.data.entities.TypeAttribute" %>
<jsp:useBean id="itemAttributes" scope="request" type="java.util.Collection<ee.ttu.rakarh.model.data.entities.TypeAttribute>" />
	<div>Muuda toode</div>
	<form method="post" action="?a=saveItem&type=<%= request.getParameter("type")%>">
		<div>Name: <input name="name" type="text" value=""/></div>
		<div>Producer: <input name="producer" type="text" value=""/></div>
		<div>Description: <input name="description" type="text" value=""/></div>
		<div>Producer code: <input name="producerCode" type="text" value=""/></div>		
		<div>--------------</div>
		<div id="form_attributes">
			<div>Toode attribuutid:</div>
			<% 
		for(TypeAttribute typeAttribute : itemAttributes){
			out.println("<div>");
			//out.println(typeAttribute.isRequired().toString());
			String typeName = typeAttribute.getItemAttributeType().getTypeName();
			out.println(typeName);
			out.println("<input name=\"" + typeAttribute.getId() + "\" type=\"text\" value=\"\"/>");
			out.println("</div>");
		}
		%>
		</div>
		<div><input type="submit" value="lisa"></div>
	</form>
</div>